{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3-final"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3",
   "language": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Approx: 1.4285714285216176\nTrue: 1.4285714285714286\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "gamma = 0.3\n",
    "T = 20\n",
    "\n",
    "approx_value = np.sum(np.power(gamma, np.arange(T)))\n",
    "true_value = 1 / (1 - gamma)\n",
    "\n",
    "print(f'Approx: {approx_value}')\n",
    "print(f'True: {true_value}')"
   ]
  }
 ]
}